
// this js file is used in IFrame.mxml

// the target html or jsp page must contains the following div element
// <div id="iframeFlex" style="position:absolute;background-color:transparent;border:0px;visibility:hidden;"></div>

function loadIFrame(sIFrameId, url){
	var frameDiv = document.getElementById(sIFrameId);
	frameDiv.innerHTML = "<iframe id='" + sIFrameId + "_frame' src='" + url + "' frameborder='0'></iframe>";
}

function moveIFrame(sIFrameId, x, y, w, h) {	
	var frameDiv = document.getElementById(sIFrameId);
	frameDiv.style.left = x;
	frameDiv.style.top = y;
	
	var iFrame = document.getElementById(sIFrameId + "_frame");	
	iFrame.width = w;
	iFrame.height = h;
}

function setIFrameVisibility(sIFrameId, bVisible){
	var visibility = bVisible ? "visible" : "hidden";
	var frameDiv = document.getElementById(sIFrameId);
	frameDiv.style.visibility = visibility;
}

